import java.util.StringTokenizer;


class P10930_39643 {

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuilder buffer = new StringBuilder();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString());
	}
	
	public static void main(String[] args) {
		String line = readLn();
		
		int counter = 1;
		while (line != null) {
			StringTokenizer st = new StringTokenizer(line);
			
			boolean a = true;
			
			int length = Integer.parseInt(st.nextToken());
		
			int[] array = new int[length];
		
			StringBuilder sb = new StringBuilder("Case #" + counter++ + ":");
			for (int k = 0; k < length; k++)  {
				array[k] = Integer.parseInt(st.nextToken());
				sb.append(" " + array[k]);
			}
			
			System.out.println(sb.toString());

			if (array[0] < 1)
				a = false;
			
			
			if (a) {
				
				int previous = array[0];
				
				for (int k = 1; k < length; k++) {
					if (previous >= array[k]) {
						a = false; 
						break;
					}
					previous = array[k];
				}
			
				if (a)
				for (int k = 1; k < length; k++) {
					
					if (hasSum(array, k)) {
						a = false;
						break;
					}
					
				}
			
			}
			
			if (a)
				System.out.println("This is an A-sequence.");
			else System.out.println("This is not an A-sequence.");
			line = readLn();
		}
	}

	private static boolean hasSum(int[] array, int k) {
		int weight = array[k];
		
//		System.out.println("w " + weight);
		
		boolean[][] grid = new boolean[k+1][weight + 1];
		
		grid[0][0] = true;
		
		for (int i = 0; i < k + 1; i++) {
			grid[i][0] = true;	
		}

		
		for (int i = 1; i < k + 1; i++) {
			for (int j = 1; j < weight + 1; j++) {
				grid[i][j] = grid[i - 1][j] 
				                         || 
				                         ( (j - array[i - 1] >= 0) ? 
				                        		 grid[i-1][j - array[i - 1]] : false);
			}
		}
		
		return grid[k][weight]; 
	}
	
}
